//! $Id$
//!
//! @file    TypeInfo.h
//! @author  Johan Andersson <skagget77@gmail.com>
//! @date    Fri Oct 02 07:35 2009
//! @ingroup IoCppDetail
//!

#if !defined(IOCPP_TYPEINFO_H)
#define IOCPP_TYPEINFO_H

#include <typeinfo>


namespace IoCpp
{
namespace Detail
{
   //!
   //! @author  Johan Andersson <skagget77@gmail.com>
   //! @date    Fri Oct 02 07:35 2009
   //! @ingroup IoCppDetail
   //!
   //! The TypeInfo class, a copyable wrapper around std::type_info.
   //!
   class IOCPP_API TypeInfo
   {
   public :
      //!
      //! Createa a new instance of the TypeInfo class.
      //!
      TypeInfo();

      //!
      //! Createa a new instance of the TypeInfo class from the specified
      //! std::type_info instance.
      //!
      //! @param info The std::type_info instance to construct this instance
      //!             from.
      //!
      TypeInfo( const std::type_info& info );

      //!
      //! Copy constructs a new instance of the TypeInfo class.
      //!
      //! @param info The instance to copy-construct this instance from.
      //!
      TypeInfo( const TypeInfo& info );

      //!
      //! Assignment operator, assigns the right hand side instance to this
      //! instance.
      //!
      //! @param  rhs The right hand side of the expression.
      //!
      //! @return This instance after assignment.
      //!
      TypeInfo& operator=( const TypeInfo& rhs );

      //!
      //! Compares this instance to the specified TypeInfo instance.
      //!
      //! @param  info The instance to compare this instance to.
      //!
      //! @return True if this instance comes before the specified instance, 
      //!         false otherwise.
      //!
      bool Before( const TypeInfo& info ) const;

      //!
      //! Returns the implementation defined name of the wrapped type.
      //!
      //! @return The implementation defined name.
      //!
      const char* Name() const;

   private :
      const std::type_info* typeinfo;
   };


   //!
   //! Compares two TypeInfo instances for order.
   //!
   //! @param  lhs The left hand side of the expression.
   //!
   //! @param  rhs The right hand side of the expression.
   //!
   //! @return True if lhs comes before rhs, false otherwise.
   //!
   bool IOCPP_API operator<( const TypeInfo& lhs, const TypeInfo& rhs );
}
}


#endif   // IOCPP_TYPEINFO_H
